<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../basePath.jsp"%>
<!DOCTYPE html>
<html>

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>商家完善资料</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
  
    <link rel="stylesheet" href="${basePath}statichcy/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${basePath}statichcy/plugins/adminLTE/css/AdminLTE.css">
    <link rel="stylesheet" href="${basePath}statichcy/plugins/adminLTE/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="${basePath}statichcy/css/style.css">
	<script src="${basePath}statichcy/plugins/jQuery/jquery-2.2.3.min.js"></script>
    <script src="${basePath}statichcy/plugins/bootstrap/js/bootstrap.min.js"></script>


    <link rel="stylesheet" href="${basePath}staticjch/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${basePath}staticjch/plugins/adminLTE/css/AdminLTE.css">
    <link rel="stylesheet" href="${basePath}staticjch/plugins/adminLTE/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="${basePath}staticjch/css/style.css">
    <script src="${basePath}staticjch/plugins/jQuery/jquery-2.2.3.min.js"></script>
    <script src="${basePath}staticjch/plugins/bootstrap/js/bootstrap.min.js"></script>

    <script src="${basePath}vue/vue.js"></script>
    <script src="${basePath}vue/axios.min.js"></script>
    
</head>

<body class="hold-transition skin-red sidebar-mini" >



            <!-- 正文区域 -->
            <section class="content">

                <div class="box-body">

                    <!--tab页-->
                    <div class="nav-tabs-custom">

                        <!--tab头-->
                        <ul class="nav nav-tabs">
                       		
                            <li class="active">
                                <a href="#home" data-toggle="tab">商家信息</a>                             
                            </li>                            
                        </ul>
                        <!--tab头/-->
						
                        <!--tab内容-->
                        <div class="tab-content">

                            <!--表单内容-->
                            <div class="tab-pane active" id="home">
                                <div class="row data-type">                                  

                                    <div class="col-md-2 title">公司名称</div>
                                    <div class="col-md-10 data">
                                        <input type="text" name="name" id="name" class="form-control"   placeholder="公司名称" value="${seller1.name}"/>
                                    </div>
									
<%--									<div class="col-md-2 title">公司手机</div>--%>
<%--                                    <div class="col-md-10 data">--%>
<%--                                        <input type="text" name="telephone" id="telephone" class="form-control"  placeholder="公司手机" value="${seller1.telephone}"/>--%>
<%--                                    </div>--%>
<%--                                    --%>
                                    <div class="col-md-2 title">公司电话</div>
                                    <div class="col-md-10 data">
                                        <input type="text" name="telephone2" id="telephone2" class="form-control"    placeholder="公司电话" value="${seller1.telephone}"/>
                                    </div>
                                    
                                    <div class="col-md-2 title">公司详细地址</div>
                                    <div class="col-md-10 data">
                                        <input type="text" name="addressDetail" id="addressDetail" class="form-control"    placeholder="公司详细地址" value="${seller1.addressDetail}"/>
                                    </div>
                                    
                                    <div class="col-md-2 title">联系人姓名</div>
                                    <div class="col-md-10 data">
                                        <input type="text" name="linkmanName" id="linkmanName" class="form-control"   placeholder="联系人姓名" value="${seller1.linkmanName}"/>
                                    </div>
                                    
                                    <div class="col-md-2 title">联系人QQ</div>
                                    <div class="col-md-10 data">
                                        <input type="text" name="linkmanQq" id="linkmanQq" class="form-control"   placeholder="联系人QQ" value="${seller1.linkmanQq}"/>
                                    </div>
                                    
                                    <div class="col-md-2 title">联系人手机</div>
                                    <div class="col-md-10 data">
                                        <input type="text" name="linkmanMobile" id="linkmanMobile" class="form-control"    placeholder="联系人手机" value="${seller1.linkmanMobile}"/>
                                    </div>
                                    
                                    <div class="col-md-2 title">联系人EMAIL</div>
                                    <div class="col-md-10 data">
                                        <input type="text" name="linkmanEmail" id="linkmanEmail" class="form-control"   placeholder="联系人EMAIL" value="${seller1.linkmanEmail}"/>
                                    </div>
                                    
                                    <div class="col-md-2 title">营业执照号</div>
                                    <div class="col-md-10 data">
                                        <input type="text" name="licenseNumber" id="licenseNumber" class="form-control"   placeholder="营业执照号" value="${seller1.licenseNumber}"/>
                                    </div>
                                     
                                    <div class="col-md-2 title">税务登记证号</div>
                                    <div class="col-md-10 data">
                                        <input type="text" name="taxNumber" id="taxNumber" class="form-control"   placeholder="税务登记证号" value="${seller1.taxNumber}"/>
                                    </div>
                                    
 									<div class="col-md-2 title">组织机构代码证</div>
                                    <div class="col-md-10 data">
                                        <input type="text" name="orgNumber" id="orgNumber" class="form-control"  placeholder="组织机构代码证" value="${seller1.orgNumber}"/>
                                    </div>
                                    
                                    <div class="col-md-2 title">法定代表人</div>
                                    <div class="col-md-10 data">
                                        <input type="text" name="legalPerson" id="legalPerson" class="form-control"   placeholder="法定代表人" value="${seller1.legalPerson}"/>
                                    </div>
                                    
 									<div class="col-md-2 title">法定代表人身份证号</div>
                                    <div class="col-md-10 data">
                                        <input type="text" name="legalPersonCardId" id="legalPersonCardId" class="form-control"   placeholder="法定代表人身份证号" value="${seller1.legalPersonCardId}"/>
                                    </div>

 									<div class="col-md-2 title">开户行名称</div>
                                    <div class="col-md-10 data">
                                        <input type="text" name="bankUser" id="bankUser" class="form-control" placeholder="开户行名称" value="${seller1.bankUser}"/>
                                    </div>
                                    
                                    <div class="col-md-2 title">开户行支行</div>
                                    <div class="col-md-10 data">
                                        <input type="text" name="bankName" id="bankName" class="form-control"   placeholder="开户行支行" value="${seller1.bankName}"/>
                                    </div>

                                    <div class="col-md-2 title">银行账号</div>
                                    <div class="col-md-10 data">
                                        <input type="text" name="bankAccount" id="bankAccount" class="form-control"   placeholder="银行账号" value="${seller1.bankAccount}"/>
                                    </div>
                                    
                                </div>
                            </div>
                            
                            
                           
                            
                        </div>
                        <!--tab内容/-->

                    </div>

                   </div>
                  <div class="btn-toolbar list-toolbar">
                      <button type="button" class="btn bg-olive btn-xs" onclick="toChange(${seller1.sellerId})" data-toggle="modal" data-target="#editModal2">立即修改</button>

				  </div>
			
            </section>
            <!-- 正文区域 /-->

            <div class="modal fade" id="editModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                            <h3 id="myModalLabel2">商品编辑</h3>
                        </div>
                        <div class="modal-body">
                            <table class="table table-bordered table-striped"  width="800px">
                                <tr>
                                    <td>公司名称</td>
                                    <td><input id="name2" class="form-control" value="" placeholder="公司名称" >  </td>
                                </tr>
<%--                                <tr>--%>
<%--                                    <td>公司手机</td>--%>
<%--                                    <td><input  id="telephone3" class="form-control"  value="" placeholder="公司手机">  </td>--%>
<%--                                </tr>--%>
                                <tr>
                                    <td>公司电话</td>
                                    <td><input  id="telephone4" class="form-control"  value="" placeholder="公司电话">  </td>
                                </tr>
                                <tr>
                                    <td>公司详细地址</td>
                                    <td><input  id="addressDetail2" class="form-control"  value="" placeholder="公司详细地址">  </td>
                                </tr>
                                <tr>
                                    <td>联系人姓名</td>
                                    <td><input  id="linkmanName2" class="form-control"  value="" placeholder="联系人姓名">  </td>
                                </tr>
                                <tr>
                                    <td>联系人QQ</td>
                                    <td><input  id="linkmanQq2" class="form-control"  value="" placeholder="联系人QQ">  </td>
                                </tr>
                                <tr>
                                    <td>联系人手机</td>
                                    <td><input  id="linkmanMobile2" class="form-control"  value="" placeholder="联系人手机">  </td>
                                </tr>
                                <tr>
                                    <td>联系人EMAIL</td>
                                    <td><input  id="linkmanEmail2" class="form-control"  value="" placeholder="联系人EMAIL">  </td>
                                </tr>
                                <tr>
                                    <td>营业执照号</td>
                                    <td><input  id="licenseNumber2" class="form-control"  value="" placeholder="营业执照号">  </td>
                                </tr>
                                <tr>
                                    <td>税务登记证号</td>
                                    <td><input  id="taxNumber2" class="form-control"  value="" placeholder="税务登记证号">  </td>
                                </tr>
                                <tr>
                                    <td>组织机构代码证</td>
                                    <td><input  id="orgNumber2" class="form-control"  value="" placeholder="组织机构代码证">  </td>
                                </tr>
                                <tr>
                                    <td>法定代表人</td>
                                    <td><input  id="legalPerson2" class="form-control"  value="" placeholder="法定代表人">  </td>
                                </tr>
                                <tr>
                                    <td>法定代表人身份证号</td>
                                    <td><input  id="legalPersonCardId2" class="form-control"  value="" placeholder="法定代表人身份证号">  </td>
                                </tr>
                                <tr>
                                    <td>开户行名称</td>
                                    <td><input  id="bankUser2" class="form-control"  value="" placeholder="开户行名称">  </td>
                                </tr>
                                <tr>
                                    <td>开户行支行</td>
                                    <td><input  id="bankName2" class="form-control"  value="" placeholder="开户行支行">  </td>
                                </tr>
                                <tr>
                                    <td>银行账号</td>
                                    <td><input  id="bankAccount2" class="form-control"  value="" placeholder="银行账号">  </td>
                                </tr>
                            </table>
                        </div>
                        <div class="modal-footer">
                            <input type="submit" class="btn btn-success" data-dismiss="modal" onclick="updateSeller()" value="保存" aria-hidden="true" />
                            <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
                        </div>
                    </div>
                </div>
            </div>
</body>
<script>
    var updateid;
    function toChange(sellerId) {

        let name2 = document.getElementById("name2");
        // let telephone3 = document.getElementById("telephone3");
        let telephone4 = document.getElementById("telephone4");
        let addressDetail2 = document.getElementById("addressDetail2");
        let linkmanName2 = document.getElementById("linkmanName2");
        let linkmanQq2 = document.getElementById("linkmanQq2");
        let linkmanMobile2 = document.getElementById("linkmanMobile2");
        let linkmanEmail2 = document.getElementById("linkmanEmail2");
        let licenseNumber2 = document.getElementById("licenseNumber2");
        let taxNumber2 = document.getElementById("taxNumber2");
        let orgNumber2 = document.getElementById("orgNumber2");
        let legalPerson2 = document.getElementById("legalPerson2");
        let legalPersonCardId2 = document.getElementById("legalPersonCardId2");
        let bankUser2 = document.getElementById("bankUser2");
        let bankName2 = document.getElementById("bankName2");
        let bankAccount2 = document.getElementById("bankAccount2");
        $.get("${basePath}Hcy/data?sellerId="+sellerId,function (data) {
            if (data) {
                name2.value = data.name;
                // telephone3.value = data.telephone;
                telephone4.value = data.telephone;
                addressDetail2.value = data.addressDetail;
                linkmanName2.value = data.linkmanName;
                linkmanQq2.value = data.linkmanQq;
                linkmanMobile2.value = data.linkmanMobile;
                linkmanEmail2.value = data.linkmanEmail;
                licenseNumber2.value = data.licenseNumber;
                taxNumber2.value = data.taxNumber;
                orgNumber2.value = data.orgNumber;
                legalPerson2.value = data.legalPerson;
                legalPersonCardId2.value = data.legalPersonCardId;
                bankUser2.value = data.bankUser;
                bankName2.value = data.bankName;
                bankAccount2.value = data.bankAccount;
                updateid = data.sellerId;

            } else {
                console.log("data为空");
            }
        });
    }

    function updateSeller() {
        let sellerId = updateid;
        let name2 = document.getElementById("name2").value;
        // let telephone3 = document.getElementById("telephone3").value;
        let telephone4 = document.getElementById("telephone4").value;
        let addressDetail2 = document.getElementById("addressDetail2").value;
        let linkmanName2 = document.getElementById("linkmanName2").value;
        let linkmanQq2 = document.getElementById("linkmanQq2").value;
        let linkmanMobile2 = document.getElementById("linkmanMobile2").value;
        let linkmanEmail2 = document.getElementById("linkmanEmail2").value;
        let licenseNumber2 = document.getElementById("licenseNumber2").value;
        let taxNumber2 = document.getElementById("taxNumber2").value;
        let orgNumber2 = document.getElementById("orgNumber2").value;
        let legalPerson2 = document.getElementById("legalPerson2").value;
        let legalPersonCardId2 = document.getElementById("legalPersonCardId2").value;
        let bankUser2 = document.getElementById("bankUser2").value;
        let bankName2 = document.getElementById("bankName2").value;
        let bankAccount2 = document.getElementById("bankAccount2").value;

        window.location.href="${basePath}Hcy/updateSeller?sellerId="+sellerId+"&name2="+name2
            +"&telephone4="+telephone4+"&addressDetail2="+addressDetail2+"&linkmanName2="+linkmanName2+"&linkmanQq2="+linkmanQq2
            +"&linkmanMobile2="+linkmanMobile2+"&linkmanEmail2="+linkmanEmail2+"&licenseNumber2="+licenseNumber2+"&taxNumber2="+taxNumber2
            +"&orgNumber2="+orgNumber2+"&legalPerson2="+legalPerson2+"&legalPersonCardId2="+legalPersonCardId2+"&bankUser2="+bankUser2
            +"&bankName2="+bankName2+"&bankAccount2="+bankAccount2;

    }


</script>
</html>